#  从字符串 找到 qq邮箱
import re
# str1 = '12344@qq.com和覅额脾气偶尔爱的abcdef@qq.com 98r-q  tttyy@sina.com'
# pattern = r'[0-9a-z]{3,12}@qq.com'
# res = re.findall(pattern,str1)
# print(res)


# str2 = 'ajkfdlafdpai110120199102024455jkaflakfjksajk11012019910202445xabcde'
# pattern = r'\d{17}[\dx]'
# # pattern = r'[0-9x-y]{18}'
# res1 = re.findall(pattern,str2)
# print(res1)


# tr1 = 'ajkfdlafdpai110120199102024455jkaflakfjksajk11012019910202445xabcde11012019910202445a'
# pattern = r'\d{17}[0-9x]'
# res1 = re.findall(pattern,tr1)
# print('try---->',res1)
#
#
# tr2 = 'ajkfdlafdpai1101201991020x4455jkaflakfjksajk11012019910202445xabcde11012019910202445a'
# pattern = r'\d{17}[0-9x]'
# res1 = re.findall(pattern,tr2)
# print(res1)


# tr3 = 'ax|bd'
# pattern = 'axbd'
# res1 = re.findall(pattern,tr3)
# print(res1)




# tr4 ='12345@qq.comnihaoa@sina.comghdalg@163.com'
# pattern = '\w+@qq.com|\w+@sina.com|\w+@163.com'
# res = re.findall(pattern,tr4)
# print(res)

# tr4 ='12345@qq.comnihaoa@sina.comghdalg@163.comafffew@159ccom'
# pattern = '\w+@\w+\.com'
# res = re.findall(pattern,tr4)
# print(res)

tr4 ='12345@qq.comnihaoa@sina.comghdalg@163.comafffew@159ccom'
pattern = '(\w+@(qq|sina|163)\.com)'
res = re.findall(pattern,tr4)
print(res)

